import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

export default new Router({
    routes: [
    	{
    		path:'',
	        redirect:"welcome"
	    },
      {
        path: '/welcome',
        component: resolved => { require(['pages/Welcome'], resolved)}
      },
      {
        path: '/login',
        component: resolved => {require(['pages/login'], resolved)}
      },
    	{
    		path:'/home',
	        component: resolve => { require(['pages/main'], resolve) },
	        children:[
	        	{
		    		  path:'',
			        redirect:'index'
		    	  },
	        	{
	        		name:'index',
		    		  path:'index',
			        component: resolve => { require(['pages/index'], resolve) }
		    	},
		    	{
		    		name:'addresslist',
		    		path:'addresslist',
            component: resolve => { require(['pages/address/AddressList'], resolve) },
		    	},
          {
            name: 'schedule',
            path: 'schedule',
            component: resolve => { require(['pages/schedule/index'], resolve) }
          },
		    	{
		    		name:"mine",
		    		path:'mine',
			        component: resolve => { require(['pages/Mine'], resolve) }
		    	}
	        ]
    	},
      {
        path: '/addresslist/search',
        component: resolve => {require(['pages/address/AddressSearch'], resolve)}
      },
      {
        path: '/address/detail',
        name: 'addressDetail',
        component: resolve => {require(['pages/address/AddressDetail'], resolve)}
      },
      {
        name: 'notify',
        path: '/notify',
        component: resolve => {require(['pages/notify/NotifyList'], resolve)}
      },
      {
        name: 'notifyDetail',
        path: '/notify/detail',
        component: resolve => {require(['pages/notify/NotifyDetail'], resolve)}
      },
      {
        name: 'asset',
        path: '/assets',
        component: resolve => {require(['pages/asset/AssetInfoList'], resolve)}
      },
      {
        name: 'assetDetail',
        path: '/asset/detail',
        component: resolve => {require(['pages/asset/AssetDetail'], resolve)}
      },
      {
        name: 'room',
        path: '/rooms',
        component: resolve => {require(['pages/room/RoomList'], resolve)}
      },
      {
        name: 'roomDetail',
        path: '/room',
        component: resolve => { require(['pages/room/RoomDetail'], resolve)}
      },
      {
        name: 'profile',
        path: '/mine/profile',
        component: resolve => { require(['pages/mine/Profile'], resolve)}
      },
      {
        name: 'changePwd',
        path: '/mine/changepwd',
        component: resolve => { require(['pages/mine/PasswordChange'], resolve)}
      },
      {
        name: 'disk',
        path: '/disk',
        component: resolve => { require(['pages/disk/DiskList'], resolve)}
      },
      {
        name: 'viewFile',
        path: '/disk/view',
        component: resolve => {require(['pages/disk/ViewFile'], resolve)}
      },
      {
        name: 'receiverDisk',
        path: '/disk/receiver',
        component: resolve => {require(['pages/disk/ReceiverDiskList'], resolve)}
      },
      {
        name: 'businessTrip',
        path: '/trip',
        component: resolve => {require(['pages/businesstrip/index'], resolve)}

      },
      {
        path: '/trip/detail',
        name: 'tripDetail',
        component: resolve => {require(['pages/businesstrip/TripDetail'], resolve)}
      },
      {
        path: '/trip/search',
        name: 'tripSearch',
        component: resolve => {require(['pages/businesstrip/TripSearch'], resolve)}
      },
      {
        path: '/project',
        name: 'project',
        component: resolve => {require(['pages/project/ProjectList'], resolve)}
      },
      {
        path: '/project/detail',
        name: 'projectDetail',
        component: resolve => {require(['pages/project/ProjectDetail'], resolve)}
      },
      {
        path: '/project/meeting/detail',
        name: 'projectMeetingDetail',
        component: resolve => {require(['pages/project/ProjectMeetingDetail'], resolve)}
      },
      {
        path: '/project/meeting/list',
        name: 'projectMeetingList',
        component: resolve => {require(['pages/project/ProjectMeetingList'], resolve)}
      },
      {
        path: '/project/contract/list',
        name: 'projectContractList',
        component: resolve => {require(['pages/project/ProjectContractList'], resolve)}
      },
      {
        path: '/project/contact/list',
        name: 'projectContactList',
        component: resolve => {require(['pages/project/ProjectContactList'], resolve)}
      },
      {
        path: '/project/search',
        name: 'projectSearch',
        component: resolve => {require (['pages/project/ProjectSearch'], resolve)}
      },
      {
        path: '/resource',
        name: 'resource',
        component: resolve => {require(['pages/resource/ResourceList'], resolve)}
      },
      {
        path: '/flow',
        name: 'flow',
        component: resolve => {require(['pages/flow/FlowList'], resolve)}
      },
      {
        path: '/document',
        name: 'document',
        component: resolve => {require(['pages/document/DocumentList'], resolve)}
      },
      {
        path: '/policy',
        name: 'policy',
        component: resolve => {require(['pages/policy/PolicyList'], resolve)}
      },
      {
        path: '/schedule/detail',
        name: 'scheduleDetail',
        component: resolve => {require(['pages/schedule/ScheduleDetail'], resolve)}
      },
      {
        path:'/schedule/add',
        name: 'scheduleAdd',
        component: resolve => {require(['pages/schedule/ScheduleAdd'], resolve)}
      },
      {
        path:'/schedule/edit:scheduleId',
        name: 'scheduleEdit',
        component: resolve => {require(['pages/schedule/ScheduleEdit'], resolve)}
      }
	]
})
